home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
- Subject: Re: Access carry flag from C
- Date: Tue, 27 Feb 1996 14:17:04 GMT
- Organization: Netcom
- Message-ID: <313311cf.52007562@nntp.ix.netcom.com>
- References: <Dn1C9z.DGv.0.net@indra.com> <1996Feb1922.17.19.879@koobera.math.uic.edu> <31298D20.41C6@bazis.nl> <danpop.824859220@rscernix> <312AFACE.41C6@bazis.nl> <TANMOY.96Feb21081640@qcd.lanl.gov> <312D8414.167E@bazis.nl> <TANMOY.96Feb23101510@qcd.lanl.gov>
- NNTP-Posting-Host: ix-dc13-13.ix.netcom.com
- X-NETCOM-Date: Tue Feb 27 6:16:56 AM PST 1996
- X-Newsreader: Forte Agent .99d/32.182
-
- tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) wrote:
-
- > <snip>
- > FK: Tanmoy Bhattacharya wrote:
- > FK: >
- > FK: > In article <312AFACE.41C6@bazis.nl> Franz Korntner <fkorntne@bazis.nl>
- > FK: > writes:
- > FK: > <snip>
- > FK: > 32 bit numbers. According to the (X3J11 / ANSI) standard, the constant
- > FK: > INT_MAX (and in this case most limits in limits.h) denotes the minimal
- > FK: > limit. It is possible that the physical limit is much higher (or lower
- > FK: > in the case of negative values). As I am only interested in the physical
- > FK: > limit, the value INT_MAX has no meaning. Only the compiler is fully aware
- > FK: > of these limits (and not a header file!) and what I really miss in the
- > FK: > standard and/or implementation is a inline function 'maxlimitof(int)',
- > FK: > analogical to 'sizeof(int)'.
- > FK: >
- > FK: > Please quote the standard. I find no discussion of this in my copy;
- > FK: > and I suspect it is incorrect.
- > FK:
- > FK: I only have a copy of the Rationale at this moment, and it is also
- > mentioned
- > FK: on page 17, Environmental limits.
- > FK:
- > FK: 2.2.4.2.1 Sizes of integral types <limits.h>. Such a large body of C code
- > FK: has been developed for the 8-bit byte machines that the integer sizes in
- > FK: such environments must be considered normative. The prescribed limits are
- > FK: minima; an implementation on a machine with 9-bit bytes can be conforming,
- > FK: as can an implementation that defines int to be the same width as long.
- > FK: page 17.
- >
- > I don't understand what you are saying! Have you read the clause?
- >
- > 5.2.4.2 (your 2.2.4.2):
- >
- > A conforming implementation shall document all the limits specified in
- > this subclause.
- >
- > 5.2.4.2.1:
- >
- > The values given below shall be replaced by constant expressions
- > ... Their implementation-defined values shall be greater in magnitude
- > (absolute value) to those shown, with the same sign.
- >
- > ...
- > --- maximum value for an object of type int
- > INT_MAX +32767
- >
- > Is there any doubt as to what this means? The only interpretation I
- > can think of is that INT_MAX is the maximum value of type int, this
- > has to be defined by the implementation, the definition is to be a
- > constant, and this constant has to exceed 32767.
- >
- > It states explicitly that INT_MAX is the maximum value of type int
- > ... how do you read anything else?
-
- That's not how 5.2.4.2.1 reads in my copy of the standard. I have:
-
- The values given below shall be replaced by constant
- expressions ... Their implementation-defined values shall be
- equal or greater in magnitude (absolute value) to those shown,
- with the same sign.
-
- This allows INT_MAX to be equal to 32767.
-
- Michael M Rubenstein
-